**# Bookmark #1 Setting

*Windows
global root  = "G:/Dropbox/Environmental Injustice/Empirical"
global rawdata = "$root/rawdata"
global workdata = "$root/workdata"
global results = "$root/results"
global outfile = "$root/outfile"

cd "$workdata"


**# Bookmark #2 Table S5 Panel A: Below College

*Firm-level COD Emission
use "$outfile/Firm_regression.dta",clear

reghdfe dummycod c.belowcl##i.post,absorb(i.id i.province#i.year) cluster(i.province i.year)

outreg2 using "$results/Table S5.xls",replace ctitle("COD Emission (=1)") ///
keep(1.post#c.belowcl belowcl 1.post) ///
addtext(Firm FE, YES, ProvincebyYear FE, YES) ///
bdec(3) tdec(3) rdec(3)

reghdfe codemission c.belowcl##i.post if dummycod==1,absorb(i.id i.province#i.year) cluster(i.province i.year)

outreg2 using "$results/Table S5.xls",append ctitle("COD Emission") ///
keep(1.post#c.belowcl belowcl 1.post) ///
addtext(Firm FE, YES, ProvincebyYear FE, YES) ///
bdec(3) tdec(3) rdec(3)


reghdfe lncod c.belowcl##i.post if dummycod==1,absorb(i.id i.province#i.year) cluster(i.province i.year)

outreg2 using "$results/Table S5.xls",append ctitle("log(COD Emission)") ///
keep(1.post#c.belowcl belowcl 1.post) ///
addtext(Firm FE, YES, ProvincebyYear FE, YES) ///
bdec(3) tdec(3) rdec(3)

reghdfe lnemissionperoutput c.belowcl##i.post if dummycod==1,absorb(i.id i.province#i.year) cluster(i.province i.year)

outreg2 using "$results/Table S5.xls",append ctitle("log(COD Emission/Output)") ///
keep(1.post#c.belowcl belowcl 1.post) ///
addtext(Firm FE, YES, ProvincebyYear FE, YES) ///
bdec(3) tdec(3) rdec(3)


**# Bookmark #3 Table S5 Panel B: Below HS
use "$outfile/Firm_regression.dta",clear

reghdfe dummycod c.belowhs##i.post,absorb(i.id i.province#i.year) cluster(i.province i.year)

outreg2 using "$results/Table S5.xls",append ctitle("COD Emission (=1)") ///
keep(1.post#c.belowhs belowhs 1.post) ///
addtext(Firm FE, YES, ProvincebyYear FE, YES) ///
bdec(3) tdec(3) rdec(3)

reghdfe codemission c.belowhs##i.post if dummycod==1,absorb(i.id i.province#i.year) cluster(i.province i.year)

outreg2 using "$results/Table S5.xls",append ctitle("COD Emission") ///
keep(1.post#c.belowhs belowhs 1.post) ///
addtext(Firm FE, YES, ProvincebyYear FE, YES) ///
bdec(3) tdec(3) rdec(3)


reghdfe lncod c.belowhs##i.post if dummycod==1,absorb(i.id i.province#i.year) cluster(i.province i.year)

outreg2 using "$results/Table S5.xls",append ctitle("log(COD Emission)") ///
keep(1.post#c.belowhs belowhs 1.post) ///
addtext(Firm FE, YES, ProvincebyYear FE, YES) ///
bdec(3) tdec(3) rdec(3)

reghdfe lnemissionperoutput c.belowhs##i.post if dummycod==1,absorb(i.id i.province#i.year) cluster(i.province i.year)

outreg2 using "$results/Table S5.xls",append ctitle("log(COD Emission/Output)") ///
keep(1.post#c.belowhs belowhs 1.post) ///
addtext(Firm FE, YES, ProvincebyYear FE, YES) ///
bdec(3) tdec(3) rdec(3)